/*--------------------------------------------------------------------------------*/
#ifndef __INTERFACE_CONTAINER__
#define __INTERFACE_CONTAINER__
/*--------------------------------------------------------------------------------*/
#include "primitives.h"
#include "interface_object.h"
#include "util.h"
/*--------------------------------------------------------------------------------*/
class INTERFACE_CONTAINER : public INTERFACE_OBJECT
{

	// -- PUBLIC

public:

    DECLARE_REF( INTERFACE_CONTAINER );

    // .. CONSTRUCTORS

    INTERFACE_CONTAINER() :
    	INTERFACE_OBJECT(),
    	ObjectTable()
    {

    }

    ~INTERFACE_CONTAINER()
    {
     
    }

    // .. METHODS

    VOID Add( const INTERFACE_OBJECT::REF & object )
    {
    	ObjectTable.Add( object );
    }

    VOID Clear()
    {
    	ObjectTable.Clear();
    }

    virtual VOID Update( const TIMER & timer )
    {
    	INDEX
    		index;

    	for_each_table_index( index, ObjectTable )
    	{
    		ObjectTable[ index ]->Update( timer );
    	}
    }

    virtual VOID Render()
    {
    	if( IsVisible() )
    	{
    		INDEX
    		index;

			for_each_table_index( index, ObjectTable )
			{
				ObjectTable[ index ]->Render();
			}
    	}
    }

    // -- PROTECTED

protected :

    // .. ATTRIBUTES

    ARRAY< INTERFACE_OBJECT::REF >
    	ObjectTable;
    
};
/*--------------------------------------------------------------------------------*/
#endif
